def binary_search(sorted_list, target):
    left, right = 0, len(sorted_list) - 1
    while left <= right:
        mid = (left + right) // 2
        if sorted_list[mid] == target:
            return mid
        elif sorted_list[mid] < target:
            left = mid + 1
        else:
            right = mid - 1
    return -1


if __name__ == "__main__":
    test_list = [2, 5, 8, 12, 16, 23, 38, 56, 72, 91]
    print(binary_search(test_list, 23))  # 5
    print(binary_search(test_list, 10))  # -1
